﻿using System.Collections.ObjectModel;
using System;
namespace Clipper.Model
{
	/// <summary>
	/// TestTubeSelfInfo:实体类(属性说明自动提取数据库字段的描述信息)
	/// </summary>
	[Serializable]
	public partial class TestTubeSelfInfo:AbstractModel
	{
		public TestTubeSelfInfo()
		{}
		#region Model
		private int _testtubeselfid;
		private string _barcode;
		private int _testtubeselfstate;
		private DateTime? _checkdatetime;
		private string _note;
        private ObservableCollection<TestTubeInfo> _testTubeInfoList; 
		/// <summary>
		/// 
		/// </summary>
		public int testTubeSelfID
		{
			set{ _testtubeselfid=value;
            NotifyPropertyChanged("testTubeSelfID");
            }
			get{return _testtubeselfid;}
		}
		/// <summary>
		/// 条码
		/// </summary>
		public string barcode
		{
			set{ _barcode=value;
                NotifyPropertyChanged("barcode");
            }
			get{return _barcode;}
		}
		/// <summary>
		/// 
		/// </summary>
		public int TestTubeSelfState
		{
			set{ _testtubeselfstate=value;
            NotifyPropertyChanged("TestTubeSelfState");
            }
			get{return _testtubeselfstate;}
		}
		/// <summary>
		/// 
		/// </summary>
		public DateTime? checkDateTime
		{
			set{ _checkdatetime=value;
            NotifyPropertyChanged("checkDateTime");
            }
			get{return _checkdatetime;}
		}
		/// <summary>
		/// 
		/// </summary>
		public string note
		{
			set{ _note=value;
            NotifyPropertyChanged("note");
            }
			get{return _note;}
		}

        

		#endregion Model
        /// <summary>
        /// 试管列表
        /// </summary>
        public ObservableCollection<TestTubeInfo> TestTubeInfoList
        {
            get
            {
                if (_testTubeInfoList == null)
                {
                    _testTubeInfoList = new ObservableCollection<TestTubeInfo>();
                }
                return _testTubeInfoList;
            }
            set
            {
                _testTubeInfoList = value;
                this.NotifyPropertyChanged("TestTubeInfoList");
            }
        }
        /// <summary>
        /// 试管架上总共的检测项数量
        /// </summary>
        public int DetectItemCount
        {
            get
            {
                int count = 0;
                if (TestTubeInfoList != null)
                {
                    foreach (TestTubeInfo tube in TestTubeInfoList)
                    {
                        count += tube.DetectItems.Count;
                    }
                }
                return count;
            }
        }
        bool _isOrder = false;
        /// <summary>
        /// 试管架的样本已经排序，对应到反应杯中
        /// </summary>
        public bool IsOrder
        {
            get
            {
                return _isOrder;
            }
            set
            {
                _isOrder = value;
                NotifyPropertyChanged("IsOrder");
            }
        }
	}
}

